ng911ok.tools._paramfactory module#

class ParameterFactory(name: str, displayName: str, direction: Literal['Input', 'Output'] = 'Input', datatype: str = 'GPString', parameterType: Literal['Required', 'Optional', 'Derived'] = 'Required', enabled: bool = True, category: str | None = None, symbology=None, multiValue: bool = False, initializer: Callable[[Parameter], None] | None = None, *, reference: str | None = None, dialog_reference: str | None = None, python_reference: str | None = None)#

Bases: object

Stores information needed to instantiate an arcpy.Parameter instance as part of the return value of a tool’s getParameterInfo() method. Also allows documentation information to be stored for the parameter.

_validate_dialog_reference(attr, value)#

attrs-compatible validator for _dialog_reference.

_validate_python_reference(attr, value)#

attrs-compatible validator for _python_reference.

_validate_reference(attr, value)#

attrs-compatible validator for _reference.

initializer(func: Callable[[Parameter], None]) None#

Decorator that uses the decorated function to finish initializing the arcpy.Parameter instance returned by param.

_dialog_reference: str | None#

Documentation for the parameter that, if provided, will be used for the dialog reference. If using this parameter, python_reference must also be provided, and reference must not be provided.

_initializer: Callable[[Parameter], None] | None#

Function used to finish initializing the parameter before it is returned. This is called by param.

_python_reference: str | None#

Documentation for the parameter that, if provided, will be used for the Python reference. If using this parameter, dialog_reference must also be provided, and reference must not be provided.

_reference: str | None#

Documentation for the parameter that, if provided, will be used as both the dialog reference and the Python reference. If using this parameter, do not supply arguments for dialog_reference or python_reference.

_symbology: Path | PathLike[str] | str | None#

Path to the symbology file to be used by the parameter.

category: str | None#

The category of the parameter.

datatype: str#

The geoprocessing data type of the parameter.

property dialog_reference: str | None#

Documentation for the parameter that will be used for the dialog reference.

direction: Literal['Input', 'Output']#

Whether the parameter is an input or output parameter.

displayName: str#

Name of the parameter when shown in the Geoprocessing pane.

enabled: bool#

Whether the parameter is enabled by default.

multiValue: bool#

Whether the parameter is a multi-value parameter.

name: str#

Name of the parameter when used in Python code.

property param: Parameter#
parameterType: Literal['Required', 'Optional', 'Derived']#

Whether the parameter is Required, Optional, or Derived.

property python_reference: str | None#

Documentation for the parameter that will be used for the Python reference.

property symbology: str | None#

Path to the symbology file, as a string, to be used by the parameter.

property xml: _Element#

Returns a <param> element for use in a tool’s XML metadata.